<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */ 
class teste extends MY_Controller {

public function index()
  {
    $this->load->helper('file');
    $data = 'teste';
    $caminho = "arquivos/".date("Y-m-d_H:i:s");
    mkdir($caminho);
    $path = $caminho."/teste.txt";
    if ( !write_file($path, $data, 'w+'))
    {
	 echo 'Unable to write the file';
    }
    else
    {
	write_file($path, $data,'a+');
	 echo 'File written!';
    }
  }
}
?>
